﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Microsoft.Phone.Shell;
using WP8Demos.Helpers;

namespace WP8Demos.ViewModels
{
    public class TilesViewModel
    {
        private ICommand selectTilesPhotosCommand;
        public TilesViewModel()
        {

        }

        public ICommand SelectTilesPhotos
        {
            get
            {
                if (selectTilesPhotosCommand == null)
                {
                    this.selectTilesPhotosCommand = new RelayCommand(SelectTilesPhotosTapped);
                }
                return selectTilesPhotosCommand;
            }
        }

        private void SelectTilesPhotosTapped()
        {
            CycleTileData cycleTile = new CycleTileData()
            {
                CycleImages = new Uri[]
                   {
                      new Uri("/Assets/CycleTiles/7.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/8.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/9.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/1.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/2.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/3.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/4.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/5.png", UriKind.Relative), 
                      new Uri("/Assets/CycleTiles/6.png", UriKind.Relative), 
                   }
            };
            ShellTile.ActiveTiles.FirstOrDefault().Update(cycleTile);
        }
    }
}
